home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / intmail2 / pop1main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-07-21  |  1.0 KB  |  52 lines

  1. unit Pop1Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, msmsg, Mssocket, Mspop, ComCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Label1: TLabel;
  12.     Label2: TLabel;
  13.     Label3: TLabel;
  14.     ServerEdit: TEdit;
  15.     UserNameEdit: TEdit;
  16.     PasswordEdit: TEdit;
  17.     BodyMemo: TMemo;
  18.     msPOPClient1: TmsPOPClient;
  19.     msMessage1: TmsMessage;
  20.     RetrieveButton: TButton;
  21.     procedure RetrieveButtonClick(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TForm1.RetrieveButtonClick(Sender: TObject);
  36. begin
  37.   msPOPClient1.Host:=ServerEdit.Text;
  38.   msPOPClient1.UserName:=UserNameEdit.Text;
  39.   msPOPClient1.Password:=PasswordEdit.Text;
  40.   msPOPClient1.Login;
  41.   if msPOPClient1.TotalMessages>0 then
  42.   begin
  43.     msPOPClient1.Retrieve;
  44.     BodyMemo.Lines:=msMessage1.Body;
  45.   end
  46.   else
  47.     ShowMessage('There are no messages');
  48.   msPOPClient1.Logout;
  49. end;
  50.  
  51. end.
  52.